<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>4-4</title>
  <script src='vue/vue.js'></script>
</head>

<body>
  <div id="root">
    <child @change='handleChange'></child> 
    <!-- 监听自定义事件 -->

    <child @click.native='handleClick1'></child> 
    <!-- 监听原生事件 -->
  </div>
  <script>
    Vue.component('child', {
      template: '<div @click="handleChildClick">this is vue</div>',
      // 监听自定义事件
      methods:{
        handleChildClick:function(){
          console.log('handleChildClick');
          this.$emit('change') // 触发自定义事件
        }
      }
    })
    var vm = new Vue({
      el: "#root",
      methods:{
        handleChange:function(){
          console.log('handleChange');
        },
        handleClick1:function(){
          console.log('handleClick1');
        }
      }
    })
  </script>
</body>

</html>